package cn.com.qiancheng.service;

import cn.com.qiancheng.dao.PasswordDao;
import cn.com.qiancheng.dto.AdminDto;
import cn.com.qiancheng.dto.Student;

public class PasswordService {
	public Student stupassUpdate(String newP, Student stu) {
		PasswordDao pd = new PasswordDao();
		int i = pd.passUpdate(stu.getStuId(), newP, 1);
		if (i != 0) {
			stu.setStuPassword(newP);
		}
		return stu;
	}
	public AdminDto adminpassUpdate(String newP, AdminDto admin) {
		PasswordDao pd = new PasswordDao();
		int i = pd.passUpdate(admin.getAdminId(), newP, 2);
		if (i != 0) {
			admin.setPassword(newP);
		}
		return admin;
	}
}
